﻿@using Novagoal.Website.Models.Views
@using Novagoal.Utils
@using Ids.Utils

@model MvpViewModel
           
<div class="formColumn">
    <fieldset>
        <legend><h2 style="text-align:center">@Model.TeamA.Name</h2></legend>
        <table class="main-table">
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Goalkeepers</b></td></tr>
            @foreach (var player in Model.TeamAPlayers.Where(p => p.Position == Enums.PlayerPositions.Goalkeeper.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamA.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Defenders</b></td></tr>
            @foreach (var player in Model.TeamAPlayers.Where(p => p.Position == Enums.PlayerPositions.Defender.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamA.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Midfielders</b></td></tr>
            @foreach (var player in Model.TeamAPlayers.Where(p => p.Position == Enums.PlayerPositions.Midfielder.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamA.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Forwards</b></td></tr>
            @foreach (var player in Model.TeamAPlayers.Where(p => p.Position == Enums.PlayerPositions.Forward.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamA.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
        </table>
    </fieldset>
</div>
<div class="formColumn">
<fieldset>
    <legend><h2 style="text-align:center">@Model.TeamB.Name</h2></legend>
    <table class="main-table">
        <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Goalkeepers</b></td></tr>
            @foreach (var player in Model.TeamBPlayers.Where(p => p.Position == Enums.PlayerPositions.Goalkeeper.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamB.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Defenders</b></td></tr>
            @foreach (var player in Model.TeamBPlayers.Where(p => p.Position == Enums.PlayerPositions.Defender.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamB.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Midfielders</b></td></tr>
            @foreach (var player in Model.TeamBPlayers.Where(p => p.Position == Enums.PlayerPositions.Midfielder.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamB.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
            <tr><td class="center ui-widget-header ui-corner-all" colspan="2"><b>Forwards</b></td></tr>
            @foreach (var player in Model.TeamBPlayers.Where(p => p.Position == Enums.PlayerPositions.Forward.ToStringValue()))
            {
                <tr>
                    <td><a href="javascript:SetMVP('@player.Name', '@player.Id', '@Model.TeamB.Name', '@Model.GameId')">@player.Name</a></td>
                    <td class="center">@player.Mvp</td>
                </tr>
            }
    </table>
    </fieldset>
</div>
